home *** CD-ROM | disk | FTP | other *** search
- on GSInit
- global gGSState
- set gGSState to [:]
- end
-
- on GSLoad aFName
- global gGSState, gSIHDPath
- set vFile to FileIO(mnew, "read", gSIHDPath & aFName)
- if not objectp(vFile) then
- return
- end if
- set vTmp to vFile(mReadLine)
- if objectp(vFile) then
- set vTmp to stripCRLF(vTmp)
- set gGSState to value(vTmp)
- if not listp(gGSState) then
- GSInit()
- end if
- vFile(mdispose)
- end if
- end
-
- on GSSave aFName
- global gSIHDPath, gGSState
- set vFile to FileIO(mnew, "write", gSIHDPath & aFName)
- if not objectp(vFile) then
- return
- end if
- set vTmp to string(gGSState) & RETURN
- set vTmp to vFile(mWriteString, vTmp)
- if not objectp(vFile) then
- return
- end if
- set vTmp to "[END]" & RETURN
- set vTmp to vFile(mWriteString, vTmp)
- if not objectp(vFile) then
- return
- end if
- if objectp(vFile) then
- vFile(mdispose)
- end if
- end
-
- on GSStatePut aModule, aKey, aValue
- global gGSState
- set vCurrState to getaProp(gGSState, aModule)
- if not listp(vCurrState) then
- set vCurrState to [:]
- end if
- setaProp(vCurrState, aKey, aValue)
- setaProp(gGSState, aModule, vCurrState)
- end
-
- on GSStateGet aModule, aKey
- global gGSState
- set vCurrState to getaProp(gGSState, aModule)
- if listp(vCurrState) then
- return getaProp(vCurrState, aKey)
- else
- return EMPTY
- end if
- end
-